<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改问卷')" />
    <style>
    
    </style>
</head>
<body>
    <div class="main-content">
        <form class="form-horizontal m" id="form-questionnaire-edit" th:object="${questionnaire}">
        	<div class="qa_list_box">
        		<div class="qa_list_title"></div>
        		<div class="qa_list_body">
	        		<ul>
	        			<li th:each="question:${questionnaire.questions}">
	        				<div class="qa_list_body_title">
	        					<i th:if="${questionnaire.isShowNo}=='0'">[[${question.no}]]</i>
	        					<span>[[${question.title}]]</span>1
	        				</div>
	        				<div class="qa_list_body_content">
	        					<ul th:if="${question.isGroup}==false">
	        						<li class="qa_a_group" th:each="a:${question.answer}">
	        							<div th:text="${a.label}"></div>
	        							<div th:utext="${a.answerInput}"></div>
	        						</li>
	        					</ul>
	        					<ul th:if="${question.isGroup}==true" th:each="g:${question.group}">
	        						<li class="qa_a_group row">
	        							<div th:text="${g.label}" class="${g.width}"></div>
	        							<div class="${g.width}" th:each="a:${g.answer}">
		        							<label th:text="${a.label}" th:if="${g.no}==0"></label>
		        							<div th:utext="${a.answerInput}"></div>
	        							</div>
	        						</li>
	        					</ul>
	        				</div>
	        			</li>
	        		</ul>
        		</div>
        	</div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "qa/questionnaire";
        $("#form-questionnaire-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-questionnaire-edit').serialize());
            }
        }
    </script>
</body>
</html>